import unittest
from ChessCommonUtils import *
from ChessBoard import * 
#return ChessCommonUtils.getColor(self._board, x, y)
class MyTest(unittest.TestCase):
    def testNotEquals(self):
      chessBoard = ChessBoard()
      chessUtil = ChessCommonUtils()
      result = chessUtil.getColor(chessBoard._board,1,1)
      self.assertNotEquals(result,0)

    def testEquals(self):
      chessUtil = ChessCommonUtils()
      chessBoard = ChessBoard()
      result = chessUtil.getColor(chessBoard._board,7,1)
      self.assertEquals(result,1)

    def testTrue(self):
      chessUtil = ChessCommonUtils()
      chessBoard = ChessBoard()
      result = chessUtil.getColor(chessBoard._board,2,7)
      myBool = (result == 0)
      self.assertTrue(myBool)

    def testFalse(self):
      chessUtil = ChessCommonUtils()
      chessBoard = ChessBoard()
      result = chessUtil.getColor(chessBoard._board,4,2)
      myBool =(result == 1)
      self.assertFalse(myBool)

if __name__ == '__main__':
    unittest.main()
